/* 
 * File:   ImageDrawer.hpp
 * Author: gustavo
 *
 * Created on August 28, 2012, 11:56 PM
 */


#ifndef IMAGE_VIEW_HPP
#define	IMAGE_VIEW_HPP

#include <gtkmm/drawingarea.h>

namespace imp {
	namespace gui {

		class ImageView : public Gtk::DrawingArea {
			/////
		public:

			enum ImageType {
				GRAY,
				RGB
			};

		private:
			ImageType type;
			unsigned char * data;
			int width, height;
			int size;

		public:
			ImageView();
			virtual ~ImageView();

		public:
			void show(unsigned char * data, int width, int height, ImageView::ImageType type);
			void stop_show();



		protected:

			//Override default signal handler:
			//virtual bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr);
			virtual bool on_expose_event(GdkEventExpose * event);
		};

	}
}

#endif	/* IMAGE_VIEW_HPP */

